package com.key.w8.http1.factory;

import java.io.File;
import java.util.HashMap;
import java.util.Map;

/**
 * @Author: k8
 * @CreateTime: 2025-04-27
 * @Version: 1.0
 */
public class FormData {
    private Map<String,String> formFiledMap;
    private Map<String, FileFiled> fileMap;

    public FormData() {

    }

    public FormData putFiled(String name, String value){
        assert name != null;
        assert value != null;
        if (formFiledMap == null){
            formFiledMap = new HashMap<>();
        }
        formFiledMap.put(name,value);
        return this;
    }

    public Map<String, String> getFormFiledMap() {
        return formFiledMap;
    }



    public FormData putFileFiled(String name, FileFiled fileFiled){
        assert name != null;
        assert fileFiled != null;
        if (this.fileMap == null){
            this.fileMap = new HashMap<>();
        }
        fileMap.put(name,fileFiled);
        return this;
    }
    public Map<String,FileFiled> getFormFileFiledMap(){
        return this.fileMap;
    }

}
